<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
<script>
onerror=handleErr;
var txt="";
function handleErr(msg,url,l){
	txt="该页面有一个错误\n\n";
	txt+="错误: " + msg + "\n";
	txt+="URL: " + url + "\n";
	txt+="行: " + l + "\n\n";
	txt+="点击确定继续。\n\n";
	alert(txt);
	return true;
}
function message(){
	adddlert("Welcome guest!");
}
</script>
</head>

<body>
<input type="button" value="查看消息" onclick="message()" />
</body>

</html>